<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MySQL MCP Server - AI驱动的数据库交互协议</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', 'Noto Serif SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #2d3748;
            line-height: 1.6;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
        }
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .code-block {
            background-color: #2d3748;
            border-radius: 0.5rem;
            overflow: hidden;
        }
        .code-header {
            background-color: #1a202c;
            padding: 0.5rem 1rem;
            display: flex;
            align-items: center;
            border-top-left-radius: 0.5rem;
            border-top-right-radius: 0.5rem;
        }
        .code-dots {
            display: flex;
            gap: 0.5rem;
        }
        .code-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }
        .code-content {
            padding: 1rem;
            overflow-x: auto;
        }
        .timeline-item::before {
            content: '';
            position: absolute;
            left: -1.5rem;
            top: 0;
            height: 100%;
            width: 2px;
            background-color: #e2e8f0;
        }
        .timeline-dot {
            position: absolute;
            left: -2rem;
            top: 0;
            width: 1rem;
            height: 1rem;
            border-radius: 50%;
            background-color: #4f46e5;
        }
        .mermaid {
            background-color: white;
            padding: 1rem;
            border-radius: 0.5rem;
        }
        .hover-underline:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4">
        <div class="max-w-6xl mx-auto text-center">
            <div class="inline-block bg-indigo-700 text-xs font-semibold px-3 py-1 rounded-full mb-4">开源项目</div>
            <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">MySQL MCP Server</h1>
            <p class="text-xl md:text-2xl max-w-3xl mx-auto opacity-90 mb-8">基于AI的自然语言数据库交互协议</p>
            <div class="flex justify-center gap-4">
                <a href="#features" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-gray-100 transition duration-300">
                    <i class="fas fa-star mr-2"></i>核心功能
                </a>
                <a href="https://github.com/designcomputer/mysql_mcp_server" target="_blank" class="bg-indigo-800 text-white px-6 py-3 rounded-lg font-medium hover:bg-indigo-900 transition duration-300">
                    <i class="fab fa-github mr-2"></i>GitHub 仓库
                </a>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-16 px-4">
        <div class="max-w-6xl mx-auto">
            <div class="flex flex-col md:flex-row gap-12 items-center">
                <div class="md:w-1/2">
                    <h2 class="text-3xl font-bold mb-6">AI时代的数据库交互新方式</h2>
                    <p class="text-lg text-gray-700 mb-6">
                        MySQL MCP Server 是一款基于 Model Context Protocol（MCP）的开源服务器，专为开发者、数据分析师和数据库管理员设计，通过 AI 助手（如 Claude Desktop）实现与 MySQL 数据库的安全交互。
                    </p>
                    <div class="bg-blue-50 border-l-4 border-blue-500 p-4 mb-6">
                        <p class="text-blue-700">
                            <strong>核心价值：</strong> 支持数据库模式探索、数据读取和 SQL 查询执行，适合需要通过自然语言管理数据库的个人开发者、小型团队和企业用户。
                        </p>
                    </div>
                    <a href="#getting-started" class="inline-flex items-center text-indigo-600 font-medium hover-underline">
                        立即开始使用 <i class="fas fa-arrow-right ml-2"></i>
                    </a>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white p-6 rounded-xl shadow-lg border border-gray-200">
                        <div class="code-block">
                            <div class="code-header">
                                <div class="code-dots">
                                    <div class="code-dot bg-red-500"></div>
                                    <div class="code-dot bg-yellow-500"></div>
                                    <div class="code-dot bg-green-500"></div>
                                </div>
                                <div class="text-gray-400 text-sm ml-2">终端示例</div>
                            </div>
                            <div class="code-content">
                                <pre class="text-gray-200 overflow-x-auto">
<span class="text-green-400">$</span> <span class="text-blue-300">docker run</span> --rm -i \
  -e MYSQL_HOST=host.docker.internal \
  -e MYSQL_USER=mcp_user \
  -e MYSQL_PASSWORD=secure_password \
  -e MYSQL_DATABASE=your_database \
  smithery/mysql-mcp-server:latest</pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Problem Solving Section -->
    <section class="py-16 px-4 bg-gray-100">
        <div class="max-w-6xl mx-auto">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">它能解决什么问题？</h2>
                <p class="text-xl text-gray-600 max-w-3xl mx-auto">传统数据库管理工具面临的痛点与MySQL MCP Server的创新解决方案</p>
            </div>
            
            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-exclamation-triangle"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">传统工具的局限</h3>
                    <p class="text-gray-600 mb-4">传统数据库管理工具（如 phpMyAdmin 或 DBeaver）通常需要用户熟悉 SQL 或复杂界面，操作门槛较高，尤其对非技术用户。</p>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-robot"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">AI协作的挑战</h3>
                    <p class="text-gray-600 mb-4">开发者在与 AI 助手协作时，缺乏直接连接数据库的标准化协议，导致数据查询和分析效率低下。</p>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <div class="text-indigo-600 text-3xl mb-4">
                        <i class="fas fa-shield-alt"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3">安全风险</h3>
                    <p class="text-gray-600 mb-4">安全问题（如直接暴露数据库凭证）常限制 AI 工具与数据库的集成，增加了数据泄露风险。</p>
                </div>
            </div>
            
            <div class="mt-12 bg-indigo-50 p-8 rounded-xl border border-indigo-100">
                <h3 class="text-2xl font-bold text-indigo-800 mb-4">MySQL MCP Server 的创新解决方案</h3>
                <p class="text-indigo-700">
                    通过 MCP 协议提供安全、结构化的接口，让 AI 助手以自然语言执行数据库操作，简化工作流并增强安全性。<br>
                    <strong>一句话总结：让数据库交互更智能、更安全、更简单。</strong>
                </p>
            </div>
        </div>
    </section>

    <!-- Features Section -->
    <section id="features" class="py-16 px-4">
        <div class="max-w-6xl mx-auto">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">核心功能概述</h2>
                <p class="text-xl text-gray-600 max-w-3xl mx-auto">MySQL MCP Server 提供了一系列强大功能，重新定义数据库交互体验</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="feature-card bg-white p-8 rounded-xl shadow-md transition duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-database text-indigo-600 text-xl"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold">模式探索</h3>
                            <p class="text-gray-600">列出数据库中的表、查看表结构和字段详情，帮助用户快速了解数据库架构，便于分析和规划。</p>
                        </div>
                    </div>
                </div>
                
                <div class="feature-card bg-white p-8 rounded-xl shadow-md transition duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-search text-indigo-600 text-xl"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold">SQL 查询执行</h3>
                            <p class="text-gray-600">支持执行 SELECT 查询（默认只读），返回格式化结果，简化数据检索和分析。</p>
                        </div>
                    </div>
                </div>
                
                <div class="feature-card bg-white p-8 rounded-xl shadow-md transition duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-lock text-indigo-600 text-xl"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold">安全连接管理</h3>
                            <p class="text-gray-600">通过环境变量配置数据库凭证，支持最小权限用户，确保安全访问，防止未授权操作。</p>
                        </div>
                    </div>
                </div>
                
                <div class="feature-card bg-white p-8 rounded-xl shadow-md transition duration-300">
                    <div class="flex items-start mb-4">
                        <div class="bg-indigo-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-brain text-indigo-600 text-xl"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-bold">AI 集成</h3>
                            <p class="text-gray-600">与 Claude Desktop 等 AI 应用无缝协作，支持自然语言查询，如"显示用户表中的所有记录"。</p>
                        </div>
                    </div>
                </div>
            </div>
            
            <div class="bg-gray-50 p-8 rounded-xl border border-gray-200">
                <h3 class="text-xl font-bold mb-4">日志与调试</h3>
                <p class="text-gray-700 mb-4">生成详细日志（~/Library/Logs/Claude/mcp*.log），便于排查 AI 与数据库交互中的问题。</p>
                <div class="code-block">
                    <div class="code-header">
                        <div class="code-dots">
                            <div class="code-dot bg-red-500"></div>
                            <div class="code-dot bg-yellow-500"></div>
                            <div class="code-dot bg-green-500"></div>
                        </div>
                        <div class="text-gray-400 text-sm ml-2">日志示例</div>
                    </div>
                    <div class="code-content">
                        <pre class="text-gray-200 overflow-x-auto">
<span class="text-green-400">$</span> <span class="text-blue-300">tail</span> -n 20 -f ~/Library/Logs/Claude/mcp*.log
[INFO] 2024-03-15 14:30:22 - Received request: list_tables
[INFO] 2024-03-15 14:30:23 - Executed: SHOW TABLES;
[INFO] 2024-03-15 14:30:23 - Found 8 tables in database
[INFO] 2024-03-15 14:30:45 - Received request: describe_table(table=users)
[INFO] 2024-03-15 14:30:45 - Executed: DESCRIBE users;</pre>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Use Cases Section -->
    <section class="py-16 px-4 bg-indigo-50">
        <div class="max-w-6xl mx-auto">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">使用场景</h2>
                <p class="text-xl text-gray-600 max-w-3xl mx-auto">MySQL MCP Server 如何赋能不同角色提升工作效率</p>
            </div>
            
            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-xs font-semibold mr-3">场景一</div>
                        <h3 class="text-xl font-bold">数据分析师快速查询</h3>
                    </div>
                    <p class="text-gray-600 mb-4">一名分析师需要从客户数据库中提取销售数据。使用 MySQL MCP Server，通过 Claude Desktop 输入"列出 orders 表中过去 30 天的记录"，服务器执行查询并返回结果，无需手动编写 SQL。</p>
                    <div class="bg-gray-50 p-4 rounded-lg">
                        <p class="text-gray-700 italic">思考问题：你的团队如何利用自然语言查询简化日常数据分析任务？</p>
                    </div>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-xs font-semibold mr-3">场景二</div>
                        <h3 class="text-xl font-bold">开发者调试应用</h3>
                    </div>
                    <p class="text-gray-600 mb-4">开发团队调试 Web 应用，需检查数据库表结构。MySQL MCP Server 允许开发者通过 VS Code 输入"描述 users 表结构"，快速获取字段详情，加速调试过程。</p>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-xs font-semibold mr-3">场景三</div>
                        <h3 class="text-xl font-bold">数据库管理员安全管理</h3>
                    </div>
                    <p class="text-gray-600 mb-4">管理员需定期检查数据库模式。MySQL MCP Server 的只读模式确保 AI 助手安全访问数据库，列出表和索引信息，避免直接暴露管理权限。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Advantages Section -->
    <section class="py-16 px-4">
        <div class="max-w-6xl mx-auto">
            <div class="flex flex-col md:flex-row gap-12">
                <div class="md:w-1/2">
                    <h2 class="text-3xl font-bold mb-6">优势与特色</h2>
                    <div class="space-y-6">
                        <div class="flex items-start">
                            <div class="bg-green-100 p-2 rounded-full mr-4">
                                <i class="fas fa-check text-green-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">自然语言交互</h3>
                                <p class="text-gray-600">通过 MCP 协议，AI 助手可直接处理自然语言请求，优于 phpMyAdmin 的手动操作界面。</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="bg-green-100 p-2 rounded-full mr-4">
                                <i class="fas fa-check text-green-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">安全优先</h3>
                                <p class="text-gray-600">强调最小权限用户和只读访问，内置 SQL 注入防护，与直接数据库连接相比更安全。</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="bg-green-100 p-2 rounded-full mr-4">
                                <i class="fas fa-check text-green-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">开源与轻量</h3>
                                <p class="text-gray-600">基于 MIT 许可，Python 实现轻量，支持 Docker 部署，适合本地化和隐私敏感场景。</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="bg-green-100 p-2 rounded-full mr-4">
                                <i class="fas fa-check text-green-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">MCP 生态兼容</h3>
                                <p class="text-gray-600">与 MCP 生态中的其他服务器（如 Git、Filesystem）协同工作，支持复杂开发工作流。</p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="md:w-1/2">
                    <h2 class="text-3xl font-bold mb-6">局限性</h2>
                    <div class="space-y-6">
                        <div class="flex items-start">
                            <div class="bg-yellow-100 p-2 rounded-full mr-4">
                                <i class="fas fa-exclamation-triangle text-yellow-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">非独立运行</h3>
                                <p class="text-gray-600">需与 MCP 客户端（如 Claude Desktop）集成，不适合直接作为独立服务器使用。</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="bg-yellow-100 p-2 rounded-full mr-4">
                                <i class="fas fa-exclamation-triangle text-yellow-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">功能局限</h3>
                                <p class="text-gray-600">当前默认只读，写操作需额外配置，可能限制复杂数据库管理需求。</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="bg-yellow-100 p-2 rounded-full mr-4">
                                <i class="fas fa-exclamation-triangle text-yellow-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">配置复杂性</h3>
                                <p class="text-gray-600">需熟悉 JSON 配置和环境变量设置，对新手有一定门槛。</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="bg-yellow-100 p-2 rounded-full mr-4">
                                <i class="fas fa-exclamation-triangle text-yellow-600"></i>
                            </div>
                            <div>
                                <h3 class="text-xl font-bold mb-2">社区维护</h3>
                                <p class="text-gray-600">开源项目更新依赖社区，存在 90+ 开放问题，可能影响新功能开发。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Architecture Diagram -->
    <section class="py-16 px-4 bg-gray-100">
        <div class="max-w-6xl mx-auto">
            <div class="text-center mb-12">
                <h2 class="text-3xl font-bold mb-4">架构概览</h2>
                <p class="text-xl text-gray-600 max-w-3xl mx-auto">MySQL MCP Server 如何集成到您的AI+数据库工作流中</p>
            </div>
            
            <div class="bg-white p-8 rounded-xl shadow-md">
                <div class="mermaid">
                    graph LR
                    A[用户] -->|自然语言请求| B[AI助手]
                    B -->|MCP协议| C[MySQL MCP Server]
                    C -->|安全连接| D[MySQL数据库]
                    D -->|查询结果| C
                    C -->|结构化数据| B
                    B -->|自然语言响应| A
                </div>
            </div>
        </div>
    </section>

    <!-- Pricing Section -->
    <section class="py-16 px-4">
        <div class="max-w-6xl mx-auto">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">使用门槛与成本</h2>
                <p class="text-xl text-gray-600 max-w-3xl mx-auto">MySQL MCP Server 是开源工具，核心功能免费，但需配置环境和可能的 AI API 密钥</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="bg-white p-8 rounded-xl shadow-md border-t-4 border-indigo-500">
                    <h3 class="text-2xl font-bold mb-6 text-center">免费版本</h3>
                    <div class="text-center mb-6">
                        <span class="text-4xl font-bold">$0</span>
                        <span class="text-gray-500">/永久</span>
                    </div>
                    <ul class="space-y-4 mb-8">
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>核心功能完全免费</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>需自托管</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-green-500 mt-1 mr-2"></i>
                            <span>依赖 MySQL 服务器和 Python 3.8+</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md border-t-4 border-blue-500">
                    <h3 class="text-2xl font-bold mb-6 text-center">高级功能</h3>
                    <div class="text-center mb-6">
                        <span class="text-4xl font-bold">按需</span>
                        <span class="text-gray-500">/使用量计费</span>
                    </div>
                    <ul class="space-y-4 mb-8">
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <span>AI 功能需 Anthropic API 密钥（如 Claude）</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <span>成本依使用量而定</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check text-blue-500 mt-1 mr-2"></i>
                            <span>其他模型（如 xAI）也支持</span>
                        </li>
                    </ul>
                    <div class="text-center">
                        <a href="https://www.anthropic.com/api" target="_blank" class="text-blue-600 hover-underline">查看 Anthropic 定价</a>
                        <span class="mx-2">•</span>
                        <a href="https://x.ai/api" target="_blank" class="text-blue-600 hover-underline">查看 xAI 定价</a>
                    </div>
                </div>
            </div>
            
            <div class="bg-yellow-50 p-8 rounded-xl border border-yellow-200">
                <h3 class="text-xl font-bold mb-4">技术要求</h3>
                <p class="text-gray-700 mb-4">需 MySQL 服务器、Python 3.8+、pip、Git，推荐 Docker 简化部署。最低硬件要求为 2GB 内存和 500MB 存储空间，推荐 4GB 内存。熟悉 JSON 和环境变量配置。</p>
                <div class="bg-white p-4 rounded-lg">
                    <p class="text-gray-700 italic">思考问题：你的开发环境是否支持 Docker 部署 MySQL MCP Server，还是更倾向于手动配置？</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Getting Started Section -->
    <section id="getting-started" class="py-16 px-4 bg-gray-100">
        <div class="max-w-6xl mx-auto">
            <div class="text-center mb-16">
                <h2 class="text-3xl font-bold mb-4">上手指南</h2>
                <p class="text-xl text-gray-600 max-w-3xl mx-auto">快速开始使用 MySQL MCP Server 的详细步骤</p>
            </div>
            
            <div class="space-y-12">
                <div class="relative pl-8 timeline-item">
                    <div class="timeline-dot"></div>
                    <div class="bg-white p-8 rounded-xl shadow-md">
                        <h3 class="text-2xl font-bold mb-4">1. 准备环境</h3>
                        <p class="text-gray-600 mb-6">确保 MySQL 服务器运行，创建专用用户：</p>
                        
                        <div class="code-block mb-6">
                            <div class="code-header">
                                <div class="code-dots">
                                    <div class="code-dot bg-red-500"></div>
                                    <div class="code-dot bg-yellow-500"></div>
                                    <div class="code-dot bg-green-500"></div>
                                </div>
                                <div class="text-gray-400 text-sm ml-2">MySQL</div>
                            </div>
                            <div class="code-content">
                                <pre class="text-gray-200 overflow-x-auto">
<span class="text-blue-300">CREATE USER</span> <span class="text-yellow-300">'mcp_user'</span><span class="text-blue-300">@</span><span class="text-yellow-300">'localhost'</span> <span class="text-blue-300">IDENTIFIED BY</span> <span class="text-yellow-300">'secure_password'</span>;
<span class="text-blue-300">GRANT SELECT ON</span> your_database.<span class="text-blue-300">* TO</span> <span class="text-yellow-300">'mcp_user'</span><span class="text-blue-300">@</span><span class="text-yellow-300">'localhost'</span>;
<span class="text-blue-300">FLUSH PRIVILEGES</span>;</pre>
                            </div>
                        </div>
                        
                        <div class="grid md:grid-cols-3 gap-4">
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <h4 class="font-bold mb-2">安装 Python 3.8+</h4>
                                <ul class="text-sm text-gray-600 space-y-1">
                                    <li>Linux: <code class="bg-gray-200 px-1 rounded">sudo apt install python3</code></li>
                                    <li>macOS: <code class="bg-gray-200 px-1 rounded">brew install python3</code></li>
                                    <li>Windows: 从 <a href="https://www.python.org" target="_blank" class="text-indigo-600 hover-underline">python.org</a> 下载</li>
                                </ul>
                            </div>
                            
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <h4 class="font-bold mb-2">安装 Git</h4>
                                <ul class="text-sm text-gray-600 space-y-1">
                                    <li>Linux: <code class="bg-gray-200 px-1 rounded">sudo apt install git</code></li>
                                    <li>macOS: <code class="bg-gray-200 px-1 rounded">brew install git</code></li>
                                    <li>Windows: 从 <a href="https://git-scm.com" target="_blank" class="text-indigo-600 hover-underline">git-scm.com</a> 下载</li>
                                </ul>
                            </div>
                            
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <h4 class="font-bold mb-2">(可选) 安装 Docker</h4>
                                <ul class="text-sm text-gray-600 space-y-1">
                                    <li>Linux: <code class="bg-gray-200 px-1 rounded">sudo apt install docker.io</code></li>
                                    <li>macOS/Windows: 从 <a href="https://www.docker.com" target="_blank" class="text-indigo-600 hover-underline">docker.com</a> 下载</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="relative pl-8 timeline-item">
                    <div class="timeline-dot"></div>
                    <div class="bg-white p-8 rounded-xl shadow-md">
                        <h3 class="text-2xl font-bold mb-4">2. 安装 MySQL MCP Server</h3>
                        
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h4 class="font-bold mb-3 text-indigo-700">Docker 方式（推荐）</h4>
                                <div class="code-block">
                                    <div class="code-header">
                                        <div class="code-dots">
                                            <div class="code-dot bg-red-500"></div>
                                            <div class="code-dot bg-yellow-500"></div>
                                            <div class="code-dot bg-green-500"></div>
                                        </div>
                                        <div class="text-gray-400 text-sm ml-2">终端</div>
                                    </div>
                                    <div class="code-content">
                                        <pre class="text-gray-200 overflow-x-auto">
<span class="text-green-400">$</span> <span class="text-blue-300">docker run</span> --rm -i \
  -e MYSQL_HOST=host.docker.internal \
  -e MYSQL_USER=mcp_user \
  -e MYSQL_PASSWORD=secure_password \
  -e MYSQL_DATABASE=your_database \
  smithery/mysql-mcp-server:latest</pre>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="font-bold mb-3 text-indigo-700">手动安装</h4>
                                <div class="code-block">
                                    <div class="code-header">
                                        <div class="code-dots">
                                            <div class="code-dot bg-red-500"></div>
                                            <div class="code-dot bg-yellow-500"></div>
                                            <div class="code-dot bg-green-500"></div>
                                        </div>
                                        <div class="text-gray-400 text-sm ml-2">终端</div>
                                    </div>
                                    <div class="code-content">
                                        <pre class="text-gray-200 overflow-x-auto">
<span class="text-green-400">$</span> <span class="text-blue-300">git clone</span> https://github.com/designcomputer/mysql_mcp_server.git
<span class="text-green-400">$</span> <span class="text-blue-300">cd</span> mysql_mcp_server
<span class="text-green-400">$</span> <span class="text-blue-300">python</span> -m venv venv
<span class="text-green-400">$</span> <span class="text-blue-300">source</span> venv/bin/activate  <span class="text-gray-500"># Windows: venv\Scripts\activate</span>
<span class="text-green-400">$</span> <span class="text-blue-300">pip install</span> -r requirements-dev.txt</pre>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="relative pl-8 timeline-item">
                    <div class="timeline-dot"></div>
                    <div class="bg-white p-8 rounded-xl shadow-md">
                        <h3 class="text-2xl font-bold mb-4">3. 配置 MCP</h3>
                        <p class="text-gray-600 mb-6">编辑 ~/.vscode/mcp.json 或用户级 mcp.json：</p>
                        
                        <div class="code-block mb-6">
                            <div class="code-header">
                                <div class="code-dots">
                                    <div class="code-dot bg-red-500"></div>
                                    <div class="code-dot bg-yellow-500"></div>
                                    <div class="code-dot bg-green-500"></div>
                                </div>
                                <div class="text-gray-400 text-sm ml-2">mcp.json</div>
                            </div>
                            <div class="code-content">
                                <pre class="text-gray-200 overflow-x-auto">
{
  <span class="text-yellow-300">"mcpServers"</span>: {
    <span class="text-yellow-300">"mysql"</span>: {
      <span class="text-yellow-300">"command"</span>: <span class="text-green-300">"uv"</span>,
      <span class="text-yellow-300">"args"</span>: [<span class="text-green-300">"--directory"</span>, <span class="text-green-300">"/path/to/mysql_mcp_server"</span>, <span class="text-green-300">"run"</span>, <span class="text-green-300">"mysql_mcp_server"</span>],
      <span class="text-yellow-300">"env"</span>: {
        <span class="text-yellow-300">"MYSQL_HOST"</span>: <span class="text-green-300">"localhost"</span>,
        <span class="text-yellow-300">"MYSQL_PORT"</span>: <span class="text-green-300">"3306"</span>,
        <span class="text-yellow-300">"MYSQL_USER"</span>: <span class="text-green-300">"mcp_user"</span>,
        <span class="text-yellow-300">"MYSQL_PASSWORD"</span>: <span class="text-green-300">"secure_password"</span>,
        <span class="text-yellow-300">"MYSQL_DATABASE"</span>: <span class="text-green-300">"your_database"</span>
      }
    }
  }
}</pre>
                            </div>
                        </div>
                        
                        <p class="text-gray-600">解决旧版 MySQL（5.7 或更早）编码问题：添加 <code class="bg-gray-200 px-1 rounded">"MYSQL_CHARSET": "utf8mb4", "MYSQL_COLLATION": "utf8mb4_unicode_ci"</code>。</p>
                    </div>
                </div>
                
                <div class="relative pl-8 timeline-item">
                    <div class="timeline-dot"></div>
                    <div class="bg-white p-8 rounded-xl shadow-md">
                        <h3 class="text-2xl font-bold mb-4">4. 启动服务器</h3>
                        
                        <div class="grid md:grid-cols-2 gap-6 mb-6">
                            <div>
                                <h4 class="font-bold mb-3 text-indigo-700">Docker</h4>
                                <div class="code-block">
                                    <div class="code-header">
                                        <div class="code-dots">
                                            <div class="code-dot bg-red-500"></div>
                                            <div class="code-dot bg-yellow-500"></div>
                                            <div class="code-dot bg-green-500"></div>
                                        </div>
                                        <div class="text-gray-400 text-sm ml-2">终端</div>
                                    </div>
                                    <div class="code-content">
                                        <pre class="text-gray-200 overflow-x-auto">
<span class="text-green-400">$</span> <span class="text-blue-300">docker run</span> --rm -i \
  -e MYSQL_HOST=host.docker.internal \
  -e MYSQL_USER=mcp_user \
  -e MYSQL_PASSWORD=secure_password \
  -e MYSQL_DATABASE=your_database \
  smithery/mysql-mcp-server:latest</pre>
                                    </div>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="font-bold mb-3 text-indigo-700">手动</h4>
                                <div class="code-block">
                                    <div class="code-header">
                                        <div class="code-dots">
                                            <div class="code-dot bg-red-500"></div>
                                            <div class="code-dot bg-yellow-500"></div>
                                            <div class="code-dot bg-green-500"></div>
                                        </div>
                                        <div class="text-gray-400 text-sm ml-2">终端</div>
                                    </div>
                                    <div class="code-content">
                                        <pre class="text-gray-200 overflow-x-auto">
<span class="text-green-400">$</span> <span class="text-blue-300">uv run</span> mysql_mcp_server --repository /path/to/mysql_mcp_server</pre>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <p class="text-gray-600 mb-6">验证：<code class="bg-gray-200 px-1 rounded">npx @modelcontextprotocol/inspector uvx mysql_mcp_server</code> 检查服务器状态。</p>
                    </div>
                </div>
                
                <div class="relative pl-8 timeline-item">
                    <div class="timeline-dot"></div>
                    <div class="bg-white p-8 rounded-xl shadow-md">
                        <h3 class="text-2xl font-bold mb-4">5. 与 AI 助手交互</h3>
                        
                        <div class="grid md:grid-cols-2 gap-6 mb-6">
                            <div>
                                <h4 class="font-bold mb-3 text-indigo-700">自然语言查询</h4>
                                <div class="bg-gray-50 p-4 rounded-lg">
                                    <p class="text-gray-700 mb-2">在 Claude Desktop 或 VS Code（带 GitHub Copilot）中，输入：</p>
                                    <p class="text-gray-800 font-medium">"列出 your_database 中的所有表。"</p>
                                    <p class="text-gray-800 font-medium mt-2">"执行 SELECT * FROM users WHERE created_at > '2025-01-01';"</p>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="font-bold mb-3 text-indigo-700">检查日志</h4>
                                <div class="code-block">
                                    <div class="code-header">
                                        <div class="code-dots">
                                            <div class="code-dot bg-red-500"></div>
                                            <div class="code-dot bg-yellow-500"></div>
                                            <div class="code-dot bg-green-500"></div>
                                        </div>
                                        <div class="text-gray-400 text-sm ml-2">终端</div>
                                    </div>
                                    <div class="code-content">
                                        <pre class="text-gray-200 overflow-x-auto">
<span class="text-green-400">$</span> <span class="text-blue-300">tail</span> -n 20 -f ~/Library/Logs/Claude/mcp*.log</pre>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="relative pl-8">
                    <div class="bg-white p-8 rounded-xl shadow-md">
                        <h3 class="text-2xl font-bold mb-4">6. 故障排除</h3>
                        
                        <div class="grid md:grid-cols-3 gap-4">
                            <div class="bg-red-50 p-4 rounded-lg border border-red-200">
                                <h4 class="font-bold text-red-700 mb-2">"连接拒绝"</h4>
                                <p class="text-red-600 text-sm">确保 MySQL 服务器运行，检查 MYSQL_HOST 和 MYSQL_PORT。</p>
                            </div>
                            
                            <div class="bg-red-50 p-4 rounded-lg border border-red-200">
                                <h4 class="font-bold text-red-700 mb-2">"认证失败"</h4>
                                <p class="text-red-600 text-sm">验证 MYSQL_USER 和 MYSQL_PASSWORD。</p>
                            </div>
                            
                            <div class="bg-red-50 p-4 rounded-lg border border-red-200">
                                <h4 class="font-bold text-red-700 mb-2">"pip 安装失败"</h4>
                                <p class="text-red-600 text-sm">MySQL MCP Server 未发布到 PyPI，需通过 Git 克隆安装。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Final CTA -->
    <section class="py-20 px-4 text-center hero-gradient text-white">
        <div class="max-w-4xl mx-auto">
            <h2 class="text-3xl md:text-4xl font-bold mb-6">准备好体验AI驱动的数据库交互了吗？</h2>
            <p class="text-xl mb-8 opacity-90">立即开始使用 MySQL MCP Server，让您的数据库管理更加智能、高效</p>
            <div class="flex justify-center gap-4">
                <a href="https://github.com/designcomputer/mysql_mcp_server" target="_blank" class="bg-white text-indigo-600 px-8 py-4 rounded-lg font-bold hover:bg-gray-100 transition duration-300">
                    <i class="fab fa-github mr-2"></i>访问 GitHub 仓库
                </a>
            </div>
        </div>
    </section>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>